import { request } from "@/utils/http";
import { RoleModel,AddRoleModel } from '@/api/acl/model/roleAuth'

export default {
    getRole(page:number,limit:number,roleName:string = ''){
        return request.get<any,RoleModel>(`/admin/acl/role/${page}/${limit}?roleName=` + `${roleName}`)
    },
    getAddRole(role:AddRoleModel){
        return request.post<any,null>(`/admin/acl/role/save`,role)
    },
    updateRoleApi(role: RoleModel){
        return request.put<any, null>( `/admin/acl/role/update`, role);
    },
    removeRolesApi(ids: string[]){
        return request.delete<any, null>(`/admin/acl/role/batchRemove`, {
            data: ids
          })
    },
    removeRoleApi(id: string){
        return request.delete<any, null>( `/admin/acl/role/remove/${id}`);
      }
}